test: sell_confirm + sell_payment_info cubits (+15 tests)#341
Merged
Conversation
Stage 17 of the coverage push. - sell_confirm_cubit (3): initial SellConfirmInitial; happy path passes through Loading and ends in Success (mock service suspends 10ms so the broadcast stream listener can observe Loading); service throw → Failure carrying the error message
Adds full coverage for the sell-side payment-info cubit (no PR conflict with #321 — the cubit source file is not in its diff, only the underlying service is). - initial state - getPaymentInfo (5): happy with isBitbox=false for SoftwareWallet, isBitbox=true for BitboxWallet, KycLevelRequiredException, RegistrationRequiredException, generic exception - validateMinAmount (6): CHF below 10 emits MinAmountNotMet; above leaves Initial; EUR scaled by getChfToEurRate (ceil); prior MinAmountNotMet is cleared back to Initial when amount rises; comma decimal normalised to dot; empty string treated as 0
TaprootFreak
added a commit
that referenced
this pull request
May 23, 2026
Tier-1 integration tests stitching SellBitboxCubit → FakeBitboxCredentials boundary → real RealUnitSellPaymentInfoService → MockClient. The cubit and the service are both real production code; only the BitBox transport and the HTTP wire are stubbed. This pins: * happy path — full swap+deposit ceremony emits two BitBox signs and the correct broadcast order/wire-shape (unsignedTx + r/s/v padding). Regression class: silently double-signing on the device or swapping leg order. * cancel mid-swap — FakeBitboxBehavior.cancel propagates as SigningCancelledException all the way to SellBitboxError instead of being silently accepted as a successful sign (PR #322 bug class). * disconnect — BitboxNotConnectedException is caught EXPLICITLY by the cubit's typed catch and emits SellBitboxBitboxRequired, not a generic Error state. Regression class: re-pair screen replaced by raw error string (PR #341). * malformed signature — FormatException from a frame-desync hits the generic catch and surfaces as SellBitboxError, NOT mis-classified as a BitBox disconnect (would mask sig bugs as UX disconnect prompts). * deposit-retry — transient 5xx on the deposit broadcast lands the cubit in SellBitboxDepositRetry with both signed envelopes preserved; the user does not have to re-sign on the device. Regression class: funds-at-risk loss of the already-signed swap (PR #338).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two sell-side cubits whose source files are NOT in PR #321's diff (only the underlying services are).
What each covers
Notes
Test plan